package com.Liux.blog;

import com.Liux.blog.dao.UserMapper;
import com.Liux.blog.entity.User;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

public class test {

    @Autowired
    public UserMapper userMapper;

    @Test
    public void tests(){
        Example example = new Example(User.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("loginName","admin");
        criteria.andEqualTo("password","123456");
        List<User> users = userMapper.selectByExample(example);
        System.out.println(users);
    }
}
